package com.teatrace.commons.util;

import com.teatrace.action.cfg.Basic;

public class PageHelper {

	public static int getFirstResult(int page, int pageSize) {
		return (page - 1) * pageSize;
	}
	
	public static long getTotalPage(long count) {
		if(count == 0) {
			return 0;
		}
		if(count % Basic.pageSize == 0) {
			return (count / Basic.pageSize);
		}
		return  (count / Basic.pageSize + 1);
	}
	
}
